package com.tubi.LinkedList;

import java.util.Iterator;
import java.util.LinkedList;

public class LinkedList1 {
    public static void main(String[] args) {

        LinkedList<String> s = new LinkedList<>();
        s.add("aaa");
        s.add("aaa1");
        s.add("aaaw");
        for (int i = 0; i < s.size(); i++) {
            System.out.println(s.get(i));
        }
        System.out.println("11111111");
        Iterator<String> iterator = s.iterator();
        while (iterator.hasNext()){
            System.out.println(iterator.next());
        }

        System.out.println("222222");
        for (String s1 : s) {
            System.out.println(s1);
        }
    }
}
